home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / security / crack_4.1-tar / APPENDIX next >
Encoding:
Text File  |  1992-06-25  |  13.6 KB  |  295 lines

  1. I'd like to thank Chris Samuel and Peter Grandi for all their help in
  2. beta-testing early versions of Crack, and in Peter's case especially,
  3. for dropping me into the deep end of troff. Die, you bastard.  As for
  4. Chris's major contribution, see "Scripts/plaster". 8->
  5.  
  6. For the v3.? versions of Crack, I'd like to thank Chris Myers, Randal
  7. Schwartz, Chris Lewis, and M.Maclaren. Also Brian Tompsett, for
  8. pointing me at the now infamous v3.2 bug, and for suggestions, patches,
  9. and enormous amounts of debugging information. To him should go the
  10. prize for "Most Vociferous Beta Tester Ever".
  11.  
  12. For Crack v4.1, the greatest help has come from the members of the crack
  13. beta team, the most vociferous of whom are:
  14.  
  15. brown@gov.llnl.ocelot, cavanaug@edu.uiuc.cogsci.lees,
  16. csx040@uk.ac.coventry.cch, dor@acl.lanl.gov, dowling@gov.ncifcrf,
  17. glad@daimi.aau.dk, kint@engr.washington.edu, korz@edu.columbia.cs.bach,
  18. morgan@edu.uky.engr, mycroft@edu.mit.ai.gnu, nelsonm@edu.orst.cs.storm,
  19. nestey@edu.colorado.denver.copper, nigelm@uk.ac.york.ohm,
  20. pcl@uk.ac.oxford.convex, phil@com.sequent, phill@com.sequent,
  21. pkh@uk.ac.nott.cs, sck@com.ibm.watson, shabby@edu.purdue.cc.mentor
  22.  
  23. - especially Fred "Mr Statistics" Korz, Paul Leyland, and shabby@purdue
  24. for all the debugging info.  Also a bit thanks to Michael Glad for being
  25. so helpful while we were writing a decent software interface between
  26. Crack and UFC.
  27.  
  28. I also wish to acknowledge the help of Kent Landfield (moderator of
  29. comp.sources.misc) and Dan "COPS" Farmer, both of them for goading me
  30. into releasing a version of Crack with fcrypt() installed. Without
  31. them, I probably would have been too timid...
  32.  
  33. Finally, my gratitude goes to my girlfriend Gilly, for her support
  34. during the bad times.  You are the everything.
  35.  
  36. --
  37. INET: aem@aber.ac.uk       JANET: aem@uk.ac.aber      BITNET: aem%aber@ukacrl
  38. UUCP: ...!mcsun!ukc!aber!aem          ARPA: aem%uk.ac.aber@nsfnet-relay.ac.uk
  39. Alec Muffett, Somewhere in the UK, Probably lying under a tree drinking cider
  40.  
  41. **********************************************************************
  42.  
  43. Several people have asked me why I don't write Crack so that it
  44. distributes dictionaries over the network and hacks the same password
  45. file on each machine, as opposed to spreading users over the network and
  46. using the same dictionaries.
  47.  
  48. There are several reasons for this, which I will outline.
  49.  
  50. The reasoning that spreading the dictionaries over the network is faster
  51. is correct in the case of cracking the passwords of ONE user - it is
  52. most efficient to run different dictionaries on him on several machines,
  53. and you will break his password eventually.
  54.  
  55. Scaling this by a factor of 'n' users causes problems.  Firstly, if a
  56. machine guesses one persons password, it must inform all others on the
  57. network not to waste time cracking him, but to get on with the other
  58. users.  This is difficult and nasty.
  59.  
  60. Secondly, it is not what Crack was designed to do.  The name "Crack" is
  61. actually a misnomer - Crack really ought to be called "Passwdcheck" or
  62. something similar, but such names lack sex appeal.
  63.  
  64. Crack is not a program designed to break the password of every user in
  65. the file.  Rather, it is designed to find weak passwords in the file, by
  66. attacking those sorts of bad passwords which are most likely to be used,
  67. in the order in which they would most easily be found (ie: are most
  68. likely to be used by a moronic user).
  69.  
  70. Crack is not designed to break user passwords; it is designed to break
  71. password files.  This is a subtle but important distinction.
  72.  
  73. If you want to break into a safe, you do not take a hammer at every bit
  74. of it in turn; instead, first you try some simple combinations, then you
  75. try blowing the hinges off, then you get out an acetylene torch and go
  76. for the bolt.  If that doesnt work, THEN you start on the walls.  You go
  77. for the bits which are most likely to be weak first.
  78.  
  79. Consider a password file with 'n' users in it.  Say that your ordinary,
  80. serial password cracker (eg: the one supplied with COPS) has a
  81. dictionary of 1000 words, and tries each word 6 ways (upper/lower/mixed
  82. case, permuted with forwards/backwards)
  83.  
  84. Also consider that out of that 1000 users, only one (the last one) has a
  85. guessable password - "fred".
  86.  
  87. Also say that it takes time 'T' seconds to encrypt a word.
  88.  
  89. If you use the "try each user in turn" method, like the COPS password
  90. cracker, you will have to wait for a time:-
  91.  
  92.     999 users * 1000 words * 6 ways * T = 5,994,000 T seconds
  93.  
  94. before you get to that last user.  Spreading this load around on a
  95. network only alleviates the number of words to be searched (divides them
  96. by the number of machines you are working on).
  97.  
  98. Thus, if you use 10 machines, the machine which will guess "fred" will
  99. get to that last user in:-
  100.  
  101.     999 * (1000 / 10) * 6 ways = 599,400 T seconds.
  102.  
  103. Alternatively you can try it the Crack way - "fred" is a word which
  104. appears in a forwards dictionary.  You will only wait:-
  105.  
  106.     999 users * 1000 words * 1st way * T = 999,000 T seconds
  107.  
  108. to get to that user.  Now split the users across 10 machines (for
  109. simplicity, as outlined above):-
  110.  
  111.     (999 / 10) users * 1000 words * 1st way = 99,900 T seconds
  112.  
  113. To get to his password, in ONLY 17% of the time taken by networking
  114. using the serial cracking method.  This is only a boundary case, but I
  115. hope I have illustrated the concept.
  116.  
  117. **********************************************************************
  118.  
  119. Crack has several other optimisations because of its structured password
  120. guesses.  The figures below are entirely empirical, but I reckon that
  121. they're as good as any:
  122.  
  123. The first pass that Crack makes is over the user data user information
  124. gleaned from the users' password field.  In my test file, this gets
  125. about 4% of the passwords (out of a total of 15% guessed).  This pass
  126. also completes very quickly, working as it does from a very small
  127. amount of data, but one which is very frequently used for passwords.
  128.  
  129. The first sweep of the second pass, consisting of lowercase dictionary
  130. words, gets about another 5% of the passwords. The length of the first
  131. sweep depends on how much CPU and how many dictionaries I supply, but
  132. using the Ultrix /usr/dict/words and my bad_pws.dat, over 4 CPUs, it
  133. doesn't take much more that a few hours.
  134.  
  135. For the further sweeps, the percentages cracked per sweep tail off, 2%,
  136. 1%, 0.5%...  But they are the people with fairly exotic passwords, and
  137. it's only common sense that that they will take some time to crack.
  138.  
  139. **********************************************************************
  140.  
  141. There is another major optimisation that I haven't mentioned.
  142.  
  143. Because of the way the UNIX crypt() algorithm works, each encryption is
  144. "salted" with a two letter sequence which is stored as the first two
  145. characters of the encrypted password.  This salting means that the word
  146. "fred" can be encrypted and appear in a password file in (literally)
  147. thousands of different ways - so long as each encryption has a
  148. different salt.
  149.  
  150. Hence, it makes sense to do things in this manner:
  151.  
  152. 1) sort and group the input data by encryption salt.
  153. 2) for each different groups' encryption salt
  154.     * get a dictionary word
  155.     * encrypt it using that salt (This is the time consuming bit)
  156.     * compare the encryption with each member of the group with that salt
  157.     * if it matches, you have guessed that users password.
  158.  
  159. This knocks (empirical guesswork time again) up to one third of the
  160. dictionary encryptions off - thus saving you 0.3 of the time all the
  161. dictionary sweeps would ordinarily take.
  162.  
  163. Crack gives this statistic when it says
  164.  
  165.     pwc: Loaded 'n' password entries into 'm' salted lines. (x%)
  166.  
  167. where 'x' is the percentage of the total passwords loaded which have
  168. different salts.
  169.  
  170. **********************************************************************
  171.  
  172. Some people have asked me how to generate safe passwords.  This, has
  173. become a religious issue, and there are now several vociferous
  174. "password geeks" on USENET, who will say "my method is the best", in
  175. the same way that some mathematicians will try to compare so-called
  176. "random number generating algorithms".
  177.  
  178. Such statements are pointless.  I'm sorry for adding to the confusion,
  179. but I must say that I think they are wrong.
  180.  
  181. Okay, so I am a security fatalist and a security philosopher, but I am
  182. not going to give and hard and fast answers; rather, I'd like to make
  183. some points and recommendations to the people out there.  Security isn't
  184. a tangible thing, it is applied psychology.
  185.  
  186. The whole point of a password is to prevent people accessing your
  187. system, getting into it from outside.  Once someone is inside your
  188. system, assuming that they have the relevant knowledge of your O/S, it
  189. is safest to assume that anyone can get to be 'superuser'.  Your only
  190. security once someone is on your system is called "security by
  191. obscurity".  If your user has sufficient knowledge, you've "had it".
  192.  
  193. The question isn't "How secure can my system be made?".
  194.  
  195. The question really should be, "How much do I care, how much can I trust?".
  196.  
  197. A system can be perfectly secure without any passwords at all, so long
  198. as it is in an environment of people who recognise its purpose and
  199. depend on it.  I say this after having had acounts on several 'public'
  200. machines, which could have been taken to bits by any competent Unix
  201. person, but were largely safe - because when someone worked out who did
  202. anything nasty, the culprit was ostracised from the community.  There
  203. _is_ a caveat to this, however.
  204.  
  205. The problem is the sort of people who go around the world 'collecting'
  206. computer accounts and breaking machines, those who have either a
  207. childish mentality or an ulterior motive.
  208.  
  209. The former are like the little boys who go around breaking windows and
  210. vandalising things 'for kicks'.  They are the ones who see every
  211. password file as a "NO ENTRY" sign, and therefore, driven by what they
  212. think is anarchy and fun, they break in and smash the place up.  Tell
  213. them that they are behaving like children, and they will behave moreso.
  214.  
  215. The latter are driven by personal motives or money.  Their reasons are
  216. too complex for me to analyse here.
  217.  
  218. The 'babyish' hackers need a lesson (which I hope that eventually they
  219. learn) that true anarchy is for the general good, and is best achieved
  220. by fiat amongst the community.  USENET is a good example - there is a
  221. lot of petty bickering and arguing, but an incredible amount of good
  222. comes out of it.  It is anarchy that the greek philosophers would have
  223. approved of.
  224.  
  225. What I am trying to say is that, when I say that if someone gets into
  226. your system, you've "had it", you should consider whether there is
  227. anything to have "had" in the first place.  There is no point in getting
  228. yourself paranoid over security - if you do, you'll lose out.  Don't be
  229. too paranoid.  Be SENSIBLE instead, and secure your system according to
  230. it's needs, and not according to some 'holy bible' of absolute security.
  231.  
  232. If someone gets into your system, you find out how they did it, patch
  233. the hole, check for back doors, brush yourself off, and start again.
  234. It's not the end of the world.
  235.  
  236. What this statement doesn't address (yet) is the needs of system
  237. managers who have a REAL need for security - be it corporate data or
  238. research work - on their system.  As I have said before, most O/S's have
  239. gaping holes in them that cannot be entirely filled, and so the crackers
  240. must be stopped on the doorstep.  At the password login.
  241.  
  242. People who say that they have a way of generating safe passwords are
  243. misinformed, IMHO.  Saying that the password "wyufwqpl" is secure is as
  244. meaningful as saying that the number "4" is random.  Password security,
  245. like any other form of computer security, is not absolute, but should
  246. be taken in context.
  247.  
  248. You can't say that a certain method will provide secure, random
  249. passwords, because, in defining an algorithm to create these passwords,
  250. you will use only a subset of all the possible passwords that could ever
  251. exist.  You have shrunk the 'search space' for the passwords.
  252.  
  253. Someone merely has to write a password cracker which will search this
  254. small subset of passwords, in order to break your system.  Passwords
  255. generated by any algorithm, human or computer based, are merly
  256. pseudo-secure, in the same way that numbers can be pseudo-random.  For
  257. illustration of this aspect of password security, read the document
  258. "Password Security, A Case History" by Morris and Thompson.
  259.  
  260. There is an incredibly large set of possible passwords in the world, and
  261. the best approach toward choosing a password is not to try to find a way
  262. to generate 'secure' passwords - there are no such things - but rather
  263. you should learn to choose passwords which are not easily searched for.
  264. Passwords which are out of the 'search space' of most password crackers
  265. like 'Crack'.
  266.  
  267. Read the Crack documentation.  See what sort of things other programs
  268. like Crack would search for.  Think of some yourself.  I am not going to
  269. specifically mention methods, you should really work something out for
  270. yourself.
  271.  
  272. At the bottom line, the password "fred" is just as secure (random) as
  273. the password "blurflpox"; the only problem is that "fred" is in a more
  274. easily searched part of the "password space".
  275.  
  276. Both of these passwords are more easily found than "Dxk&2+15^N" however.
  277. Now you must ask yourself if you can cope with remembering "Dxk&2+15^N".
  278.  
  279. **********************************************************************
  280.  
  281. Some time ago, I was listening to the REM album 'Green' on the way back
  282. from the Cropredy folk festival, whilst thinking over things to do to
  283. Crack, and I was struck (not for the first time) by the words of the
  284. first verse to 'World Leader Pretend':-
  285.  
  286.     I sit at my table, and wage war upon myself.
  287.     It seems like it's all, it's all for nothing.
  288.     I know the barricades, and I know the mortar in the wall
  289.     I recognise the weapons, I use them well.
  290.  
  291.     This is my mistake, let me make it good,
  292.     I raised the wall, and I will be the one to knock it down...
  293.  
  294. - writing password cracking programs gets to you after a bit.
  295.